/* Copyright 203-2115 AtomWare Technology Pty Limited
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * The flowing information must be keep 
 * RemindEventService.java
 * netty-socket-io
 * 2013年9月16日上午10:13:10
 * @author 屈甲康
 * QQ285799123
 * mailto:qujiakang@gmail.com
 */

package org.jackysoft.service;

import java.net.MalformedURLException;
import java.util.Collection;

import org.jackysoft.data.ServiceProvider;
import org.jackysoft.entity.nosql.RemindEvent;
import org.jackysoft.query.RunnerQuery;

public interface RemindEventService extends ServiceProvider<RemindEvent>{
    /**
     * 获取可用提醒事件
     * @return 事件集合
     * */  
	Collection<RemindEvent> getValidEvents(); 
	/**
	 * 立即提醒提醒一批事件
	 * @param socket 提醒管理端
	 * */
	void fireAllValidEvents()throws MalformedURLException;
	
	/**
	 * 立即提醒提醒一批事件
	 * @param socket 提醒管理端
	 * */
	void fireEvents(RunnerQuery query);
	
	/**
	 * 立即提醒提醒一批事件
	 * @param socket 提醒管理端
	 * */
	void fireEvents(Collection<RemindEvent> events);
	
	
	
      /**
       * 改变提醒事件的有效性
       * @param valid true is valid via false
       * @param id 事件编号
       * */
    void changeValid(boolean valid,String... id);
    
    void changeOneValid(boolean valid,String id);
      /**
       * 设置事件过期
       * @param externalKey 业务键
       * @param receiver 提醒对象
       * 
       * */
     void expireEvent(int eventType,String externalKey ,String receiver);
      
     
     /**
      * 获取可用提醒事件
      * @return 事件集合
      * */  
 	Collection<RemindEvent> getValidEvents(String owner); 
   
      
}
